<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加角色</title>
<link rel="stylesheet" type="text/css" href="component/jquery-easyui-1.5.1/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="component/jquery-easyui-1.5.1/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="component/jquery-easyui-1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="component/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
</head>
<body>
<script type="text/javascript">
function save(){
	$.ajax({
	    type: "post",
	    url:"addRole.action",
	    data:$('#addRole').serialize()
	    +"&addDate="+$('#addDate').datebox('getValue')
	    +"&accessName="+$('#accessName').datebox('getValue'),
	    async: true,
	    error: function(request) {
	      alert("抱歉，添加失败");
	    },
	    success: function(data) {
	    	alert("添加成功!");
	    	window.location.href = 'Page.action?number='+${count+1};
	    }
	});
}
</script>

<body>
	<table border="1">
		<tr>
			<td colspan="1">RoleName</td>
			<td colspan="1">RoleDescription</td>
			<td colspan="1">AddDate</td>
			<td colspan="1">Access</td>
		</tr>
		<form id="addRole" action="addRole.action" method="post" >
			<tr>
				<td colspan="1"><input id="roleName" name="RoleName" required="required" type="text"></td>
				<td colspan="1"><input id="roleDescription" name="RoleDescription" required="required" type="text"/></td>
				<td colspan="1"><input class="easyui-datebox"  id="addDate" name="addDate" value="$('#addDate').datebox('getValue')" type="text"/></td>
				<td colspan="1"><select class="easyui-combobox" id="accessName" name="accessName" style="width:50%;" >
					<c:forEach items="${accessList}" var="list">
						<option <c:if test='${role.accessName==list.accessName}'>selected="selected"</c:if>value="${list.accessName}">${list.accessName}</option>							
					</c:forEach>
				</select>			
			</td>				
				</tr>
			<input onclick="save()" type="button" value="Save"/>
		</form>	
	</table>
	
</body>
</html>

i